<template>
     <van-panel style="margin-top: 10px;">
        <van-card
            v-for="goods in goodsList"
            :key="goods.goodsId"
            :num="goods.productNum"
            :price="goods.totalPrice | money"
            :desc="goods.goodsSpecName"  
            :title="goods.title"
            :thumb="`/images/${goods.titleImage}`"
        >
             <div slot="footer">
                <van-button  v-if="goods.commentStatus == 0" size="mini" @click="$router.push({path: '/order/comment/' + goods.orderItemId, query: {price: goods.totalPrice, img: goods.titleImage, name: goods.title, desc: goods.goodsSpecName}})">去评价</van-button>
                <van-button  v-if="goods.commentStatus == 1" size="mini" disabled>已评价</van-button>
            </div>
        </van-card>

    </van-panel>
</template>

<script>
export default {
    name: 'commentList',
    data() {
        return {
            goodsList: [],
        }
    },

    methods: {
        getDetail() {
            this.$http.post('/shop/order/front/getUserOrderDetail', {
                orderId: this.$route.params.id
            }).then(res => {
                if (res.status === 0) {
                    this.goodsList = res.data.shopOrderItemsList;
                }
            })
        },
    },

    created() {
        this.getDetail();
    }
}
</script>

<style>

</style>
